//
//  MTInviteModel.swift
//  MT
//
//  Created by 陈悦 on 2020/5/28.
//  Copyright © 2020 张强. All rights reserved.
//

import ObjectMapper
import MTCategory

class MTInviteModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var rewardTicketAmount: Int?
    
    var result: [MTInviteListModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
        rewardTicketAmount  <- map["rewardTicketAmount"]
    }
}

class MTInviteListModel: Mappable {
    /// 用户等级Id
    var levelId: String?
    /// 用户等级名称
    var levelName: String?
    /// 用户昵称
    var nickname: String?
    /// 用户极光ID
    var userName: String?
    /// 用户头像
    var headerUrl: String?
    /// 用户ID
    var userId: Int?
    /// 用户性别 0 male 1 - female
    var sex: Int?
    /// 奖励金额
    var rewardTicketAmount: Int?
    ///
    var giftReward: MTGiftRewardModel?
    /// 升级奖励
    var lastGrowth: MTLastGrowthModel?
    
    required public init?(map: Map) {

    }
    
    func mapping(map: Map) {
        rewardTicketAmount  <- map["rewardTicketAmount"]
        levelId  <- map["levelId"]
        levelName  <- map["levelName"]
        nickname  <- map["nickname"]
        userName  <- map["userName"]
        userId  <- map["userId"]
        sex  <- map["sex"]
        giftReward  <- map["giftReward"]
        lastGrowth  <- map["lastGrowth"]
        headerUrl  <- map["headerUrl"]
    }
}

class MTGiftRewardModel: Mappable {
    /// 累计收金额
    var ticketAmount: Int?
    /// 累计收礼奖励
    var rewardTicketAmount: Int?
    ///
    var status: Int?
    
    required public init?(map: Map) {

    }
    
    func mapping(map: Map) {
        rewardTicketAmount  <- map["rewardTicketAmount"]
        ticketAmount  <- map["ticketAmount"]
        status  <- map["status"]
    }
}

class MTLastGrowthModel: Mappable {
    /// 下一级名称
    var currentLevelName: String?
    /// 上一级名称
    var lastLevelName: String?
    /// 奖励金额钻石
    var rewardTicketAmount: Int?
    /// 状态
    var status: Int?
    
    required public init?(map: Map) {

    }
    
    func mapping(map: Map) {
        rewardTicketAmount  <- map["rewardTicketAmount"]
        currentLevelName  <- map["currentLevelName"]
        lastLevelName  <- map["lastLevelName"]
        status  <- map["status"]
    }
}


